/*
 *
 *
 */

#ifndef WINDOW_DIALOG_H
#define WINDOW_DIALOG_H

#include "gkt_types.h"

#ifdef __cplusplus
extern "C" {
#endif

#define WINDOW_DIALOG_ATTR_STYLE_BITS	8
#define WINDOW_DIALOG_ATTR_HINT_BIG_BITS		8
#define WINDOW_DIALOG_ATTR_HINT_0_STYLE_BITS	8
#define WINDOW_DIALOG_ATTR_HINT_1_STYLE_BITS	8

#define WINDOW_DIALOG_ATTR_STYLE_SHIFT	0
#define WINDOW_DIALOG_ATTR_HINT_BIG_SHIFT	\
	(WINDOW_DIALOG_ATTR_STYLE_SHIFT + WINDOW_DIALOG_ATTR_STYLE_BITS)
#define WINDOW_DIALOG_ATTR_HINT_0_STYLE_SHIFT	\
	(WINDOW_DIALOG_ATTR_HINT_BIG_SHIFT + WINDOW_DIALOG_ATTR_HINT_BIG_BITS)
#define WINDOW_DIALOG_ATTR_HINT_1_STYLE_SHIFT	\
	(WINDOW_DIALOG_ATTR_HINT_0_STYLE_SHIFT + WINDOW_DIALOG_ATTR_HINT_0_STYLE_BITS)

/*
 * WINDOW_DIALOG_STYLE_OK:
 *   INTERACT  : ONLY OK
 *	 AUTO_EXIT : 1s after voice is over
 *   DECISION  : INSIGNIFICANCE
 * WINDOW_DIALOG_STYLE_CANCEL_OK:
 *   INTERACT  : CANCEL & OK
 *	 AUTO_EXIT : Xs after voice is over
 *   DECISION  : User-Set or Default(WINDOW_DIALOG_DECISION_CANCEL) 
 * WINDOW_DIALOG_STYLE_RETURN_CONTINUE:
 *   INTERACT  : RETURN & nCONTINUE
 *	 AUTO_EXIT : Xs after voice is over
 *   DECISION  : User-Set or Default(WINDOW_DIALOG_DECISION_CANCEL)
 */
enum {
	WINDOW_DIALOG_STYLE_OK = 0,
	WINDOW_DIALOG_STYLE_NO_YES,
	WINDOW_DIALOG_STYLE_CANCEL_OK,
	WINDOW_DIALOG_STYLE_RETURN_CONTINUE,
	WINDOW_DIALOG_STYLE_MAX
};
#define WINDOW_DIALOG_ATTR_STYLE(style)	\
	((style) << WINDOW_DIALOG_ATTR_STYLE_SHIFT)

#define WINDOW_DIALOG_ATTR_HINT_BIG(hint_big)	\
	((hint_big) << WINDOW_DIALOG_ATTR_HINT_BIG_SHIFT)

/* hint type */
enum {
	/* GENERAL HINT TYPE */
	WINDOW_DIALOG_HINT_NORMAL = 0,	/* TEXT_COLOR : WHITE */
	WINDOW_DIALOG_HINT_IMPORTANT,	/* TEXT_COLOR : RED */
	/* SPECIFIC HINT TYPE */
	WINDOW_DIALOG_HINT_SUCCESS,		/* TEXT_COLOR : GREEN */
	WINDOW_DIALOG_HINT_FAILED,	/* TEXT_COLOR : RED */
	WINDOW_DIALOG_HINT_TIMEOUT,	/* TEXT_COLOR : WHITE */
	WINDOW_DIALOG_HINT_MAX
};
#define WINDOW_DIALOG_ATTR_HINT_TYPE(which, hint_type)	\
	((hint_type) << WINDOW_DIALOG_ATTR_HINT_##which##_STYLE_SHIFT)

enum {
	WINDOW_DIALOG_DECISION_OK = 0,
	WINDOW_DIALOG_DECISION_CANCEL,
	WINDOW_DIALOG_DECISION_MAX
};

typedef struct {
	union {
		uint32_t	attr;
		struct {
			uint32_t	style : WINDOW_DIALOG_ATTR_STYLE_BITS;		/* [input] WINDOW_DIALOG_STYLE_XXX */
			uint32_t	hint_text_big : WINDOW_DIALOG_ATTR_HINT_BIG_BITS;	/* 0 or 1 */
			uint32_t	hint_0_type : WINDOW_DIALOG_ATTR_HINT_0_STYLE_BITS;	/* [input] hint_0 WINDOW_DIALOG_HINT_XXX */
			uint32_t	hint_1_type : WINDOW_DIALOG_ATTR_HINT_1_STYLE_BITS;	/* [input] hint_1 WINDOW_DIALOG_HINT_XXX */
		};
	};

	uint32_t	title_text;		/* [input] text_id or text_ptr */
	uint32_t	hint_text[2];	/* [input] text_id or text_ptr */
	uint32_t	voice_id;		/* [input] WINDOW_DIALOG_DECISION_OK/CANCEL */

	uint32_t	decision;	/* [output] decision */
} window_dialog_data_s;


int window_dialog_show(uint32_t attr, uint32_t title_text_id,
			uint32_t hint_0_text_id, uint32_t hint_1_text_id, 
			uint32_t voice_id);
int window_dialog_show_big_prompt(uint32_t hint_type,
			uint32_t title_text_id, uint32_t hint_text_id, 
			uint32_t voice_id);
int window_dialog_show_big_confirm(uint32_t hint_type,
			uint32_t title_text_id, uint32_t hint_text_id, 
			uint32_t voice_id);
uint32_t window_dialog_decision(void);


#ifdef __cplusplus
}
#endif

#endif	/* WINDOW_DIALOG_H */

